/*
 * GET home page.
 */
var controllers = require('../controllers/index.js');

module.exports = {
    start : function(app) {
        app.get('/page/:page', controllers.index.index);
        app.all('/category/create', controllers.sign.auth_user, controllers.category.create);
        app.get('/category/:slug', controllers.category.index);
        app.get('/category/:slug/page/:page', controllers.category.index);
        app.all('/post/create', controllers.sign.auth_user, controllers.post.create);
        app.get('/post/:slug', controllers.post.index);
        app.all('/signin', controllers.sign.signin);
        app.all('/signup', controllers.sign.auth_user, controllers.sign.signup);
        app.get('/', controllers.sign.auth_user, controllers.index.index);
        app.get('/media', controllers.media.get);
        app.post('/media/create', controllers.sign.auth_user, controllers.media.create);
        app.get('/xiami/song/:id', controllers.xiami.getMedia);
        app.all('*', function(req, res) {
            res.send(404, '404');
        });
    }
};